/**
 * Copyright (C) 2022 - 长期
 * All rights reserved.
 * <p>
 * 版权所有 (C) 中国烟草总公司
 */
package com.itzhoun.service;

import com.itzhoun.model.pojo.MangerInfo;
import com.itzhoun.model.pojo.SysRole;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhounan
 * @date 2024/01/19 17:11
 * @Description
 */
@Service
public class UserService {


    //实际业务需要去数据库查询
    public MangerInfo findUserByUsername(String username){
        MangerInfo mangerInfo = new MangerInfo();
        mangerInfo.setUsername(username);
        mangerInfo.setState(1);
        mangerInfo.setName("系统管理元");

        // 随机数
        mangerInfo.setSalt("4b19f44ab70960df77faf0f4bed1d2f2");
        mangerInfo.setPassword("f64e70b9e1b06bfbb9e1f6bf209465e5");

        List<SysRole> roles = new ArrayList<>();
        SysRole role = new SysRole();
        role.setId(1);
        role.setRole("admin");
        role.setDescription("超级管理员");
        roles.add(role);
        mangerInfo.setSysRoles(roles);
        return mangerInfo;
    }
}
